package com.ryan.spring.annotation.collection;

import com.ryan.spring.annotation.model.Person;

import java.util.Comparator;

/**
 * Created by kaimin on 31/1/2019.
 * time : 14:43
 */
public class Student implements Comparable<Student>,Cloneable {
    private int age;

    public Student(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public int compareTo(Student o) {
        return o.age-this.age;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
